<?php defined('SYSPATH') or die();?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>思途CMS{$coreVersion}</title>
    {template 'stourtravel/public/public_min_js'}
    {php echo Common::getCss('style.css,base.css,base_new.css'); }
    {php echo Common::getScript("uploadify/jquery.uploadify.min.js,product_add.js,choose.js,st_validate.js,jquery.colorpicker.js,jquery.jqtransform.js,imageup.js"); }
    {php echo Common::getCss('uploadify.css','js/uploadify/'); }
</head>

<body>

<!--顶部-->
{php Common::getEditor('jseditor','',$sysconfig['cfg_admin_htmleditor_width'],500,'Sline','','print',true);}
<table class="content-tab">
    <tr>
        <td width="119px" class="content-lt-td" valign="top">
            {template 'stourtravel/public/leftnav'}
            <!--右侧内容区-->
        </td>
        <td valign="top" class="content-rt-td" style="overflow:auto;">
            <div class="cfg-header-bar">
                <a href="javascript:;" class="fr btn btn-primary radius mt-6 mr-10" onclick="window.location.reload()">刷新</a>
            </div>
            <form id="product_fm">
                <div class="product-add-div" >
                    <ul class="info-item-block" style="border-top: solid 1px #e5e5e5;">

                        <li class="truename">
                            <span class="item-hd">合同名称：</span>
                            <div class="item-bd">
                                <input type="text" name="title" data-required="true" value="{$info['contractnName']}" class="input-text w900 required">
	                            <span class="item-text ml-10 c-999">*合同条款内容与思途无关</span>
                            </div>
                        </li>
                        <li>
                            <span class="item-hd">所属产品：</span>
                            <div class="item-bd">
                                <div class="select-box w150">
                                    <select class="select" name="typeid">
                                        <option value="0">请选择</option>
                                        {loop $models $m}
                                        <option value="{$m['id']}" {if $info['typeid']==$m['id']}selected="selected"{/if} >{$m['shortname']}</option>
                                        {/loop}
                                    </select>
                                </div>
                            </div>
                        </li>
                        <li>
                            <span class="item-hd">乙方信息：</span>
                            <div class="item-bd">
                                <div class="select-box w150">
                                    <select class="select" name="partyBid">
                                        {if $default_partyB}
                                        <option value="0">请选择</option>
                                        {/if}
                                        {loop $party $p}
                                        <option value="{$p['id']}" {if $info['partyBid']==$p['id']||(!$info['partyBid']&&$default_partyB==$p['id'])}selected="selected"{/if} >{$p['name']}</option>
                                        {/loop}
                                    </select>
                                </div>
                            </div>
                        </li>
                        <li>
                            <span class="item-hd">合同类型：</span>
                            <div class="item-bd">
                                <div class="select-box w150">
                                    <select class="select" name="type" id="type">
<!--                                        <option value="1" {if $info['type']==1}selected="selected"{/if}>自定义合同</option>-->
                                        <option value="2" selected="selected">12301合同</option>
                                    </select>
                                </div>
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">合同模板类型：</span>
                            <div class="select-box w150">
                                <select class="select" name="templateId">
                                    <option value="A00001" {if $info['templateId']==A00001}selected="selected"{/if}>境内游</option>
                                    <option value="C00001" {if $info['templateId']==C00001}selected="selected"{/if}>出境游</option>
                                    <option value="D00001" {if $info['templateId']==D00001}selected="selected"{/if}>一日游</option>
                                    <option value="F00001" {if $info['templateId']==F00001}selected="selected"{/if}>赴台游</option>
                                    <option value="E00001" {if $info['templateId']==E00001}selected="selected"{/if}>代订代办</option>
                                </select>
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">签章图片(必传)：</span>
                            <div class="item-bd">
                                <a href="javascript:;" id="fx_logo_btn" class="btn btn-primary radius size-S mt-3">上传图片</a>
                                <div id="fx_logo_pic" class="mt-10">
                                    {if !empty($info['stamp'])}
                                    <img class="up-img-area" src="{$info['stamp']}">
                                    <input type="hidden" name="stamp" value="{$info['stamp']}">
                                    {/if}
                                </div>
                            </div>
                        </li>
                        <li>
                            <span class="item-hd">是否多人签署：</span>
                            <div class="item-bd">
                                <label class="radio-label"><input type="radio" name="isMultiSignatory"  {if $info['isMultiSignatory']==1}checked="checked"{/if} value="1">是</label>
                                <label class="radio-label ml-20"><input type="radio" name="isMultiSignatory"  {if $info['isMultiSignatory']==0}checked="checked"{/if} value="0">否</label>
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">其他约定内容：</span>
                            <div class="item-bd">
                                <textarea class="w900" name="supplementaryClause" id="supplementaryClause_content">{$info['supplementaryClause']}</textarea>
                            </div>
                        </li>
                    </ul>


                    <ul class="info-item-block" style="border-top: solid 1px #e5e5e5;">
                        <li class="12301">
                            <span class="item-hd">签约社信息：</span>
                        </li>
                        <li class="12301">
                            <span class="item-hd">经办人姓名：</span>
                            <div class="item-bd">
                                <input type="text" name="transactorName" data-required="true" value="{$info['travelAgency']['transactorName']}" class="input-text w900 required">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">经办人电话：</span>
                            <div class="item-bd">
                                <input type="text" name="transactorPhone" data-required="true" value="{$info['travelAgency']['transactorPhone']}" class="input-text w900 required">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">旅行社名称：</span>
                            <div class="item-bd">
                                <input type="text" name="agencyName" data-required="true" value="{$info['travelAgency']['agencyName']}" class="input-text w900 required">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">旅行社许可证号：</span>
                            <div class="item-bd">
                                <input type="text" name="travelAgencyLicenseNumber" data-required="true" value="{$info['travelAgency']['travelAgencyLicenseNumber']}" class="input-text w900 required">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">旅行社工商注册号：</span>
                            <div class="item-bd">
                                <input type="text" name="businessLicenseNumber" data-required="true" value="{$info['travelAgency']['businessLicenseNumber']}" class="input-text w900 required">（旅行社统一社会信用代码/工商注册号）
                            </div>
                        </li>
                        </ul>

                    <ul class="info-item-block" style="border-top: solid 1px #e5e5e5;">
                        <li class="12301">
                            <span class="item-hd">解决争议部分：</span>
                        </li>
                        <li class="12301">
                            <span class="item-hd">解决办法：</span>
                            <div class="item-bd w150">
                                <div class="select-box w150">
                                    <select class="select" name="resolution">
                                        <option value="1" {if $info['dispute']['resolution']==1}selected="selected"{/if}>提交仲裁委员会仲裁</option>
                                        <option value="2" {if $info['dispute']['resolution']==2}selected="selected"{/if}>向人民法院提起诉讼</option>
                                    </select>
                                </div>
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">仲裁委名称：</span>
                            <div class="item-bd">
                                <input type="text" name="tribunalName" data-required="true" value="{$info['dispute']['tribunalName']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">法院名称：</span>
                            <div class="item-bd">
                                <input type="text" name="courtName" data-required="true" value="{$info['dispute']['courtName']}" class="input-text w900">
                            </div>
                        </li>
                    </ul>

                    <ul class="info-item-block" style="border-top: solid 1px #e5e5e5;">
                        <li class="12301">
                            <span class="item-hd">成团约定部分：</span>
                        </li>
                        <li class="12301">
                            <span class="item-hd">解决办法：</span>
                            <div class="item-bd w150">
                                <div class="select-box w150">
                                    <select class="select" name="groupAgreement_resolution">
                                        <option value="1"{if $info['groupAgreement']['resolution']==1}selected="selected"{/if} >委托其他社</option>
                                        <option value="2" {if $info['groupAgreement']['resolution']==2}selected="selected"{/if}>延期出团</option>
                                        <option value="3" {if $info['groupAgreement']['resolution']==3}selected="selected"{/if}> 改签其他路线</option>
                                        <option value="4" {if $info['groupAgreement']['resolution']==4}selected="selected"{/if}>解除合同</option>
                                    </select>
                                </div>
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">最低成团人数：</span>
                            <div class="item-bd">
                                <input type="text" name="leastCustomerNumber" data-required="true" value="{$info['groupAgreement']['leastCustomerNumber']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">可托其它社组团：</span>
                            <div class="item-bd">
                                <label class="radio-label"><input type="radio" name="agreeToTransfer"  {if $info['groupAgreement']['agreeToTransfer']==1}checked="checked"{/if} value="1">是</label>
                                <label class="radio-label ml-20"><input type="radio" name="agreeToTransfer"  {if $info['groupAgreement']['agreeToTransfer']==0}checked="checked"{/if} value="0">否</label>
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">是否同意延期：</span>
                            <div class="item-bd">
                                <label class="radio-label"><input type="radio" name="agreeToDelay"  {if $info['groupAgreement']['agreeToDelay']==1}checked="checked"{/if} value="1">是</label>
                                <label class="radio-label ml-20"><input type="radio" name="agreeToDelay"  {if $info['groupAgreement']['agreeToDelay']==0}checked="checked"{/if} value="0">否</label>
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">可改为其它线路：</span>
                            <div class="item-bd">
                                <label class="radio-label"><input type="radio" name="agreeToChangeLine"  {if $info['groupAgreement']['agreeToChangeLine']==1}checked="checked"{/if} value="1">是</label>
                                <label class="radio-label ml-20"><input type="radio" name="agreeToChangeLine"  {if $info['groupAgreement']['agreeToChangeLine']==0}checked="checked"{/if} value="0">否</label>
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">是否同意解除合同：</span>
                            <div class="item-bd">
                                <label class="radio-label"><input type="radio" name="agreeToTerminate"  {if $info['groupAgreement']['agreeToTerminate']==1}checked="checked"{/if} value="1">是</label>
                                <label class="radio-label ml-20"><input type="radio" name="agreeToTerminate"  {if $info['groupAgreement']['agreeToTerminate']==0}checked="checked"{/if} value="0">否</label>
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">是否同意拼团：</span>
                            <div class="item-bd">
                                <label class="radio-label"><input type="radio" name="agreeToMerge"  {if $info['groupAgreement']['agreeToMerge']==1}checked="checked"{/if} value="1">是</label>
                                <label class="radio-label ml-20"><input type="radio" name="agreeToMerge"  {if $info['groupAgreement']['agreeToMerge']==0}checked="checked"{/if} value="0">否</label>
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">受委托社信息：</span>
                            <div class="item-bd">
                                <input type="text" name="transferToCompanyName" data-required="true" value="{$info['groupAgreement']['transferToCompanyName']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">拼团旅行社名称：</span>
                            <div class="item-bd">
                                <input type="text" name="mergeToCompanyName" data-required="true" value="{$info['groupAgreement']['mergeToCompanyName']}" class="input-text w900">
                            </div>
                        </li>
                    </ul>

                    <ul class="info-item-block" style="border-top: solid 1px #e5e5e5;">
                        <li class="12301">
                            <span class="item-hd">导游部分：</span>
                        </li>
                        {if $info['tourGuides']}
                        {loop $info['tourGuides'] $m}
                        <li class="12301">
                            <span class="item-hd">导游姓名：</span>
                            <div class="item-bd">
                                <input type="text" name="tourGuides_name" data-required="true" value="{$m['name']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">电话号码：</span>
                            <div class="item-bd">
                                <input type="text" name="tourGuides_phone" data-required="true" value="{$m['phone']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">导游证号：</span>
                            <div class="item-bd">
                                <input type="text" name="tourGuideID" data-required="true" value="{$m['tourGuideID']}" class="input-text w900">
                            </div>
                        </li>
                        {/loop}
                        {else}
                        <li class="12301">
                            <span class="item-hd">导游姓名：</span>
                            <div class="item-bd">
                                <input type="text" name="tourGuides_name" data-required="true" value="{$m['name']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">电话号码：</span>
                            <div class="item-bd">
                                <input type="text" name="tourGuides_phone" data-required="true" value="{$m['phone']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">导游证号：</span>
                            <div class="item-bd">
                                <input type="text" name="tourGuideID" data-required="true" value="{$m['tourGuideID']}" class="input-text w900">
                            </div>
                        </li>
                        {/if}
                    </ul>
                    <ul class="info-item-block" style="border-top: solid 1px #e5e5e5;">
                        <li class="12301">
                            <span class="item-hd">行程部分：</span>
                        </li>
                        <li class="12301">
                            <span class="item-hd">行程模式：</span>
                            <div class="item-bd">
                                <label class="radio-label"><input type="radio" name="inputType"  {if $info['inputType']==1}checked="checked"{/if} value="1">简易</label>
                                <label class="radio-label ml-20"><input type="radio" name="inputType"  {if $info['inputType']==0}checked="checked"{/if} value="0">标准</label>
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">出发日期：</span>
                            <div class="item-bd">
                                <input type="text" name="startDate" data-required="true" value="{$info['itinerary']['startDate']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">行程天数：</span>
                            <div class="item-bd">
                                <input type="text" name="days" data-required="true" value="{$info['itinerary']['days']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">过夜天数：</span>
                            <div class="item-bd">
                                <input type="text" name="nights" data-required="true" value="{$info['itinerary']['nights']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">线路名称：</span>
                            <div class="item-bd">
                                <input type="text" name="routeName" data-required="true" value="{$info['itinerary']['routeName']}" class="input-text w900">
                            </div>
                        </li>
                    </ul>


                    <ul class="info-item-block" style="border-top: solid 1px #e5e5e5;">
                        <li class="12301">
                            <span class="item-hd">游客名单部分：</span>
                        </li>
                        <li class="12301">
                            <span class="item-hd">游客总人数：</span>
                            <div class="item-bd">
                                <input type="text" name="totalNumber" data-required="true" value="{$info['touristsInfo']['totalNumber']}" class="input-text w900 required">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">成人总人数：</span>
                            <div class="item-bd">
                                <input type="text" name="adultNumber" data-required="true" value="{$info['touristsInfo']['adultNumber']}" class="input-text w900 required">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">儿童数量：</span>
                            <div class="item-bd">
                                <input type="text" name="childNumber" data-required="true" value="{$info['touristsInfo']['childNumber']}" class="input-text w900 required">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">紧急联系人姓名：</span>
                            <div class="item-bd">
                                <input type="text" name="emergencyContactName" data-required="true" value="{$info['touristsInfo']['emergencyContactName']}" class="input-text w900 required">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">紧急联系人电话：</span>
                            <div class="item-bd">
                                <input type="text" name="emergencyContactPhone" data-required="true" value="{$info['touristsInfo']['emergencyContactPhone']}" class="input-text w900 required">
                            </div>
                        </li>
                    </ul>



                    <ul id="tourists" class="info-item-block" style="border-top: solid 1px #e5e5e5;">
                        <li class="12301">
                            <span class="item-hd">游客列表：</span>
                        </li>
                        {loop $info['touristsInfo']['tourists'] $k $m}
                        <li class="12301 tourists{$k}">
                            <span class="item-hd">显示序列：</span>
                            <div class="item-bd">
                                <input type="text" name="tourists[{$k}][number]" data-required="true" value="{$m['number']}" class="input-text w900 required">非0
                            </div>
                        </li>
                        <li class="12301 tourists{$k}">
                            <span class="item-hd">是否为签署人：</span>
                            <div class="item-bd">
                                <label class="radio-label"><input type="radio" name="tourists[{$k}][isSigner]"  {if $m['isSigner']}checked="checked"{/if} value="1">是</label>
                                <label class="radio-label ml-20"><input type="radio" name="tourists[{$k}][isSigner]"  {if $m['isSigner']==0}checked="checked"{/if} value="0">否</label>
                            </div>
                        </li>
                        <li class="12301 tourists{$k}">
                            <span class="item-hd">姓名：</span>
                            <div class="item-bd">
                                <input type="text" name="tourists[{$k}][name]" data-required="true" value="{$m['name']}" class="input-text w900 required">
                            </div>
                        </li>
                        <li class="12301 tourists{$k}">
                            <span class="item-hd">性别：</span>
                            <div class="item-bd">
                                <input type="text" name="tourists[{$k}][gender]" data-required="true" value="{$m['gender']}" class="input-text w900 required">
                            </div>
                        </li>
                        <li class="12301 tourists{$k}">
                            <span class="item-hd">国籍：</span>
                            <div class="item-bd">
                                <input type="text" name="tourists[{$k}][nationality]" data-required="true" value="{$m['nationality']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301 tourists{$k}">
                            <span class="item-hd">电话：</span>
                            <div class="item-bd">
                                <input type="text" name="tourists[{$k}][phone]" data-required="true" value="{$m['phone']}" class="input-text w900 required">
                            </div>
                        </li>
                        <li class="12301 tourists{$k}">
                            <span class="item-hd">地址：</span>
                            <div class="item-bd">
                                <input type="text" name="tourists[{$k}][address]" data-required="true" value="{$m['address']}" class="input-text w900 ">
                            </div>
                        </li>
<!--                        <li>-->
<!--                            <label>证件信息ID</label>-->
<!--                        </li>-->
                        <li class="12301 tourists{$k}">
                            <span class="item-hd">证件类型：</span>
                            <div class="item-bd w150">
                                <div class="select-box w150">
                                    <select class="select" name="tourists[{$k}][IDType]">
                                        <option value="1"{if $m['ID']['IDType']==1}selected="selected"{/if} >身份证</option>
                                        <option value="2" {if $m['ID']['IDType']==2}selected="selected"{/if}>士官证</option>
                                        <option value="3" {if $m['ID']['IDType']==3}selected="selected"{/if}> 港澳通行证</option>
                                        <option value="4" {if $m['ID']['IDType']==7}selected="selected"{/if}>护照</option>
                                        <option value="5" {if $m['ID']['IDType']==4}selected="selected"{/if}>赴台证</option>
                                        <option value="6" {if $m['ID']['IDType']==5}selected="selected"{/if}>回乡证</option>
                                        <option value="7" {if $m['ID']['IDType']==6}selected="selected"{/if}>台胞证</option>
                                        <option value="8" {if $m['ID']['IDType']==8}selected="selected"{/if}>其他</option>
                                    </select>
                                </div>
                            </div>
                        </li>
                        <li class="12301 tourists{$k}">
                            <span class="item-hd">证件号：</span>
                            <div class="item-bd">
                                <input type="text" name="tourists[{$k}][IDNumber]" data-required="true" value="{$m['ID']['IDNumber']}" class="input-text w900 required">
                            </div>
                        </li>

                            <li class="12301 tourists{$k}">
                                <span class="item-hd"></span>
                                <div class="item-bd">
                                    <a href="javascript:;" onclick="del_tour({$k})"  class="btn btn-primary radius size-S mt-3">删除此游客</a>
                                </div>
                            </li>
                                {/loop}
                        </ul>

                    <ul class="info-item-block" style="border-top: solid 1px #e5e5e5;">
                        <li class="12301">
                            <span class="item-hd">添加游客：</span>
                            <div class="item-bd">
                                <a href="javascript:;" onclick="add_tour(++t)"  class="btn btn-primary radius size-S mt-3">添加游客</a>
                            </div>
                        </li>
                    </ul>



                    <ul class="info-item-block" style="border-top: solid 1px #e5e5e5;">
                        <li class="12301">
                            <span class="item-hd">签署人/游客代表：</span>
                        </li>
                        <li class="12301">
                            <span class="item-hd">签约方式：</span>
                            <div class="item-bd w150">
                                <div class="select-box w150">
                                    <select class="select" name="mode">
                                        <option value="1" {if $info['signatory']['mode']==1}selected="selected"{/if}>线上签约（短信签约）</option>
                                    </select>
                                </div>
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">代签者/经办人：</span>
                            <div class="item-bd">
                                <input type="text" name="signatory_name" data-required="true" value="{$info['signatory']['name']}" class="input-text w900 ">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">证件类型：</span>
                            <div class="item-bd w150">
                                <div class="select-box w150">
                                    <select class="select" name="signatory_IDType">
                                        <option value="1"{if $info['signatory']['ID']['IDType']==1}selected="selected"{/if} >身份证</option>
                                        <option value="2" {if $info['signatory']['ID']['IDType']==2}selected="selected"{/if}>士官证</option>
                                        <option value="3" {if $info['signatory']['ID']['IDType']==3}selected="selected"{/if}> 港澳通行证</option>
                                        <option value="4" {if $info['signatory']['ID']['IDType']==7}selected="selected"{/if}>护照</option>
                                        <option value="5" {if $info['signatory']['ID']['IDType']==4}selected="selected"{/if}>赴台证</option>
                                        <option value="6" {if $info['signatory']['ID']['IDType']==5}selected="selected"{/if}>回乡证</option>
                                        <option value="7" {if $info['signatory']['ID']['IDType']==6}selected="selected"{/if}>台胞证</option>
                                        <option value="8" {if $info['signatory']['ID']['IDType']==8}selected="selected"{/if}>其他</option>
                                    </select>
                                </div>
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">证件号：</span>
                            <div class="item-bd">
                                <input type="text" name="signatory_IDNumber" data-required="true" value="{$info['signatory']['ID']['IDNumber']}" class="input-text w900 ">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">联系电话：</span>
                            <div class="item-bd">
                                <input type="text" name="signatory_phone" data-required="true" value="{$info['signatory']['phone']}" class="input-text w900 ">
                            </div>
                        </li>
                    </ul>


                    <ul class="info-item-block" style="border-top: solid 1px #e5e5e5;">
                        <li class="12301">
                            <span class="item-hd">费用部分：</span>
                        </li>
                        <li class="12301">
                            <span class="item-hd">成人费用：</span>
                            <div class="item-bd">
                                <input type="text" name="adultCost" data-required="true" value="{$info['cost']['adultCost']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">儿童费用：</span>
                            <div class="item-bd">
                                <input type="text" name="childCost" data-required="true" value="{$info['cost']['childCost']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">单房差费用：</span>
                            <div class="item-bd">
                                <input type="text" name="singleSupplementCost" data-required="true" value="{$info['cost']['singleSupplementCost']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">总费用：</span>
                            <div class="item-bd">
                                <input type="text" name="totalCost" data-required="true" value="{$info['cost']['totalCost']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">支付方式：</span>
                            <div class="item-bd w150">
                                <div class="select-box w150">
                                    <select class="select" name="paymentMethod">
                                        <option value="1"{if $info['cost']['paymentMethod']==1}selected="selected"{/if} >现金</option>
                                        <option value="2" {if $info['cost']['paymentMethod']==2}selected="selected"{/if}>转账</option>
                                        <option value="3" {if $info['cost']['paymentMethod']==3}selected="selected"{/if}> 线上支付</option>
                                    </select>
                                </div>
                            </div>
                        </li>
                    </ul>



                    <ul class="info-item-block" style="border-top: solid 1px #e5e5e5;">
                        <li class="12301">
                            <span class="item-hd">保险部分：</span>
                        </li>
                        <li class="12301">
                            <span class="item-hd">保险购买方式：</span>
                            <div class="item-bd w150">
                                <div class="select-box w150">
                                    <select class="select" name="purchaseMethod">
                                        <option value="1"{if $info['insurance']['purchaseMethod']==1}selected="selected"{/if} >委托旅行社购买</option>
                                        <option value="2" {if $info['insurance']['purchaseMethod']==2}selected="selected"{/if}>自行购买</option>
                                        <option value="3" {if $info['insurance']['purchaseMethod']==3}selected="selected"{/if}> 放弃购买</option>
                                        <option value="4" {if $info['insurance']['purchaseMethod']==3}selected="selected"{/if}> 同意旅行社赠送人身意外保险</option>
                                    </select>
                                </div>
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">保险产品名称：</span>
                            <div class="item-bd">
                                <input type="text" name="productName" data-required="true" value="{$info['insurance']['productName']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">保险公司名称：</span>
                            <div class="item-bd">
                                <input type="text" name="company" data-required="true" value="{$info['insurance']['company']}" class="input-text w900">
                            </div>
                        </li>
                    </ul>


                    <ul class="info-item-block" style="border-top: solid 1px #e5e5e5;">
                        <li class="12301">
                            <span class="item-hd">自费项目部分：</span>
                        </li>
                        <li class="12301">
                            <span class="item-hd">日期：</span>
                            <div class="item-bd">
                                <input type="text" name="date" data-required="true" value="{$info['activities']['date']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">地点：</span>
                            <div class="item-bd">
                                <input type="text" name="place" data-required="true" value="{$info['activities']['place']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">项目：</span>
                            <div class="item-bd">
                                <input type="text" name="item" data-required="true" value="{$info['activities']['item']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">费用：</span>
                            <div class="item-bd">
                                <input type="text" name="fee" data-required="true" value="{$info['activities']['fee']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">最长停留时间：</span>
                            <div class="item-bd">
                                <input type="text" name="stayDuration" data-required="true" value="{$info['activities']['stayDuration']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">其他说明：</span>
                            <div class="item-bd">
                                <input type="text" name="memo" data-required="true" value="{$info['activities']['memo']}" class="input-text w900">
                            </div>
                        </li>
                    </ul>



                    <ul class="info-item-block" style="border-top: solid 1px #e5e5e5;">
                        <li class="12301">
                            <span class="item-hd">购物部分：</span>
                        </li>
                        <li class="12301">
                            <span class="item-hd">是否含购：</span>
                            <div class="item-bd">
                                <label class="radio-label"><input type="radio" name="hasShopping"  {if $info['hasShopping']}checked="checked"{/if} value="1">是</label>
                                <label class="radio-label ml-20"><input type="radio" name="hasShopping"  {if $info['hasShopping']==0}checked="checked"{/if} value="0">否</label>
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">购物景点名称：</span>
                            <div class="item-bd">
                                <input type="text" name="shoppingViewSpot" data-required="true" value="{$info['shoppingViewSpot']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">购物信息：</span>
                        </li>
                        <li class="12301">
                            <span class="item-hd">日期：</span>
                            <div class="item-bd">
                                <input type="text" name="shoppings_date" data-required="true" value="{$info['shoppings']['date']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">购物地点：</span>
                            <div class="item-bd">
                                <input type="text" name="shoppings_place" data-required="true" value="{$info['shoppings']['place']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">购物场所名称：</span>
                            <div class="item-bd">
                                <input type="text" name="shoppingPlace" data-required="true" value="{$info['shoppings']['shoppingPlace']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">主要产品信息：</span>
                            <div class="item-bd">
                                <input type="text" name="goods" data-required="true" value="{$info['shoppings']['goods']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">最长停留时间：</span>
                            <div class="item-bd">
                                <input type="text" name="shoppings_stayDuration" data-required="true" value="{$info['shoppings']['stayDuration']}" class="input-text w900">
                            </div>
                        </li>
                        <li class="12301">
                            <span class="item-hd">其他说明：</span>
                            <div class="item-bd">
                                <input type="text" name="shoppings_memo" data-required="true" value="{$info['shoppings']['memo']}" class="input-text w900">
                            </div>
                        </li>
                    </ul>




                        <!--12301合同内容-->

                </div>
                <input type="hidden" id="id" name="id" value="{$info['id']}">
            </form>
            <div class="clear clearfix pt-20 pb-20">
                <a class="btn btn-primary radius size-L ml-115" id="save_btn" href="javascript:;">保存</a>
            </div>
        </td>
    </tr>
</table>

<script>
    //保存状态
    window.is_saving = 0;
    var ctype=1;
    $(document).ready(function(e) {
        window.content=window.JSEDITOR('supplementaryClause_content');
        window.content.ready(function(){
            //window.content.setHeight(400);
        })


        //$("#product_fm input").st_readyvalidate();

        $("#save_btn").click(function(e) {
            //检测是否是在保存状态
            if(is_saving == 1){
                return false;
            }
            window.is_saving = 1;

            var classstr=".required";
            var validate=$(classstr).st_govalidate({require:function(element,index){
                    $(element).css("border","1px solid red");
                    if(index==1)
                    {
                        var switchDiv=$(element).parents(".product-add-div").first();
                        if(switchDiv.is(":hidden")&&!switchId)
                        {
                            var switchId=switchDiv.attr('id');
                            var columnId=switchId.replace('content','column');
                            $("#"+columnId).trigger('click');
                        }

                    }
                }});
            if(validate==true)
            {
                ST.Util.showMsg('保存中',6,10000);
                $.ajaxform({
                    url   :  SITEURL+"contract/admin/dispose/add_ajax",
                    method  :  "POST",
                    form  : "#product_fm",
                    dataType  :  "html",
                    success  :  function(result)
                    {
                        var text = result;
                        if(window.isNaN(text))
                        {
                            ZENG.msgbox._hide();
                            ST.Util.showMsg('保存失败',5);
                        }
                        else
                        {
                            // Ext.get('line_id').setValue(text);
                            $("#id").val(text);
                            ST.Util.showMsg('保存成功',4)
                        }
                        window.is_saving = 0;
                    }});

            }
            else
            {
                ST.Util.showMsg("请将信息填写完整",1,1200);
                window.is_saving = 0;
            }
        });

        //合同内容切换
        var options = $("#type option:selected").val();
        if(options==1){
            $(".12301").hide();
        }else{
            $(".zidingyi").hide();
        }
        $("#type").change(function (e) {
            var type=$(this).val();
            if(type==1)
            {
                $(".12301").hide();
                $(".zidingyi").show();
                ctype=1;
            }else{
                $(".zidingyi").hide();
                $(".12301").show();
                ctype=2;
            }
        });

        //上传签章
        $('#fx_logo_btn').click(function () {
            ST.Util.showBox('上传图片', SITEURL + 'image/insert_view', 0, 0, null, null, document, {
                loadWindow: window,
                loadCallback: Insert
            });

            function Insert(result, bool) {
                var len = result.data.length;
                for (var i = 0; i < len; i++) {
                    var temp = result.data[i].split('$$');
                    var html = "<img class='up-img-area' src='" + temp[0] + "' />";
                    html += "<input type='hidden' name='stamp' value='" + temp[0] + "'/>"
                    $("#fx_logo_pic").html(html);
                }
            }
        })
    });

    //添加游客
    var tours={php echo $info['touristsInfo']['tourists'] ? count($info['touristsInfo']['tourists']):0};
    var t=tours;
    // if(!tours){
    //     var t=0;
    // }else {
    //     var t=tours.length;
    // }
    function add_tour(t) {
        var str='';
        str+= '<li class="12301 tourists'+t+'">\n' +
            '<span class="item-hd">显示序列：</span>\n' +
            '<div class="item-bd">\n' +
            '<input type="text" name="tourists['+t+'][number]" data-required="true" value="" class="input-text w900 required">非0\n' +
            '</div>\n' +
            '</li>';
        str+='<li class="12301 tourists'+t+'">\n' +
            '<span class="item-hd">是否为签署人：</span>\n' +
            '<div class="item-bd">\n' +
            '<label class="radio-label"><input type="radio" name="tourists['+t+'][inputType]"  >是</label>\n' +
            '<label class="radio-label ml-20"><input type="radio" name="tourists['+t+'][inputType]">否</label>\n' +
            '</div>\n' +
            '</li>';
        str+='<li class="12301 tourists'+t+'">\n' +
            '                            <span class="item-hd">姓名：</span>\n' +
            '                            <div class="item-bd">\n' +
            '                                <input type="text" name="tourists['+t+'][name]" data-required="true" value="" class="input-text w900 required">\n' +
            '                            </div>\n' +
            '                        </li>';
        str+='<li class="12301 tourists'+t+'">\n' +
            '                            <span class="item-hd">性别：</span>\n' +
            '                            <div class="item-bd">\n' +
            '                                <input type="text" name="tourists['+t+'][gender]" data-required="true" value="" class="input-text w900 required">\n' +
            '                            </div>\n' +
            '                        </li>';
        str+='<li class="12301 tourists'+t+'">\n' +
            '                            <span class="item-hd">国籍：</span>\n' +
            '                            <div class="item-bd">\n' +
            '                                <input type="text" name="tourists['+t+'][nationality]" data-required="true" value="" class="input-text w900">\n' +
            '                            </div>\n' +
            '                        </li>';
        str+='<li class="12301 tourists'+t+'">\n' +
            '                            <span class="item-hd">电话：</span>\n' +
            '                            <div class="item-bd">\n' +
            '                                <input type="text" name="tourists['+t+'][phone]" data-required="true" value="" class="input-text w900 required">\n' +
            '                            </div>\n' +
            '                        </li>';
        str+='<li class="12301 tourists'+t+'">\n' +
            '                            <span class="item-hd">地址：</span>\n' +
            '                            <div class="item-bd">\n' +
            '                                <input type="text" name="tourists['+t+'][address]" data-required="true" value="" class="input-text w900 required">\n' +
            '                            </div>\n' +
            '                        </li>';
        str+='<li class="12301 tourists'+t+'">\n' +
            '                            <span class="item-hd">证件类型：</span>\n' +
            '                            <div class="item-bd w150">\n' +
            '                                <div class="select-box w150">\n' +
            '                                    <select class="select" name="tourists['+t+'][IDType]">\n' +
            '                                        <option value="1">身份证</option>\n' +
            '                                        <option value="2" >士官证</option>\n' +
            '                                        <option value="3"> 港澳通行证</option>\n' +
            '                                        <option value="4">护照</option>\n' +
            '                                        <option value="5">赴台证</option>\n' +
            '                                        <option value="6">回乡证</option>\n' +
            '                                        <option value="7">台胞证</option>\n' +
            '                                        <option value="8">其他</option>\n' +
            '                                    </select>\n' +
            '                                </div>\n' +
            '                            </div>\n' +
            '                        </li>';
        str+='<li class="12301 tourists'+t+'">\n' +
            '                            <span class="item-hd">证件号：</span>\n' +
            '                            <div class="item-bd">\n' +
            '                                <input type="text" name="tourists['+t+'][IDNumber]" data-required="true" value="" class="input-text w900 required">\n' +
            '                            </div>\n' +
            '                        </li>\n' ;
                str+='<li class="12301 tourists'+t+'">\n' +
                    '                            <span class="item-hd">：</span>\n' +
                    '                            <div class="item-bd">\n' +
                    '                                 <a href="javascript:;" onclick="del_tour('+t+')"  class="btn btn-primary radius size-S mt-3">删除此游客</a>\n' +
                    '                            </div>\n' +
                    '                        </li>\n' ;
        $("#tourists").append(str);
    }
    //删除游客
    function del_tour(k) {
        $(".tourists"+k).remove();
    }


</script>



</body>
</html>
